<template>
  <NormalForm
    ref="normalForm"
    :form-items="formItems$1"
    :inline="true"
  />
</template>
<script setup lang="jsx">
import { computed ,ref } from 'vue';
import NormalForm from './NormalForm.vue';
import { ElButton } from 'element-plus';
const props = defineProps({
    formItems:{
        type:Array,
        default:()=>[]
    },
})


const emit = defineEmits(['search','addItem'])

const normalForm = ref(null)

const formItems$1 = computed(()=>{
    return [
        ...props.formItems,
        {
            com:<>
                <ElButton onClick={()=>normalForm.value.form.resetFields()}>重置</ElButton>
                <ElButton type='primary' onClick={()=>{emit('search')}}>查询</ElButton>
            </>
    
        },
        {
            com:<ElButton  type='primary' onClick={()=>{emit('addItem',normalForm.value.formData)}}>新增</ElButton>,
            itemAttrs:{
                style:{float:'right'}
            }
    
        }
    ]
})



</script>